/*
**Author erow
**
*/
#include <iostream>
#include <sys/time.h>
#include <math.h>
#include <unistd.h>
#include <stdio.h>
#include "transitHub.h"
#include "action.h"
#include "Serial.h"
#include "Action.h"
#include "robotModel.h"
#include "Object.h"
#include "gaitStep.h"
#include "Trajectory.h"

string logger::m_path="log/";
using namespace Eigen;

int main(int arg,char** args)
{

    //port:1,baud_rate:57600
    // cin>>port>>way;
    logger::m_path="log/";
    logger::m_level=DEBUG;
    transitHub* port=transitHub::getInstance();
    int data[20]= {0};

    while(!port->portOpen(1,57600))
    {
        cout<<"fail!\n";
        cout<<"(port way)//ttyS$port"<<endl;
        return 1;
    }
    double dy,t;cin>>dy>>t;
    InvertPendulum pen(3.5,dy,32);

    pen.speed_up(t);
    cout<<"swing"<<endl;
    pen.swing_left(0.01);
    return 0;
}
